//package com.etc.common;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.sql.DataSource;
//
//// 语义的Component
//@Configuration
//public class DruidConfig {
//
//    // 返回值放入容器， 参数可以DI
//    @Bean
//    public DataSource getDruidDataSource(MyProperties myProperties) {
//
//        DruidDataSource ds = new DruidDataSource();
//        ds.setUrl(myProperties.getUrl());
//        ds.setDriverClassName(myProperties.getDriver());
//        ds.setUsername(myProperties.getUsername());
//        ds.setPassword(myProperties.getPassword());
//
//        ds.setInitialSize(myProperties.getInitialSize());
//        ds.setMaxActive(myProperties.getMaxActive());
//
//        return ds;
//    }
//}
